home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / texthook / texthook.frm < prev    next >
Text File  |  1995-09-06  |  3KB  |  112 lines

  1. VERSION 2.00
  2. Begin Form Main 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "TXTHOOK.DLL 'No Hide' DEMO"
  5.    ClientHeight    =   3360
  6.    ClientLeft      =   1725
  7.    ClientTop       =   2145
  8.    ClientWidth     =   5820
  9.    Height          =   3765
  10.    Left            =   1665
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   3360
  15.    ScaleWidth      =   5820
  16.    Top             =   1800
  17.    Width           =   5940
  18.    Begin TextBox Text1 
  19.       Height          =   2060
  20.       Left            =   120
  21.       MultiLine       =   -1  'True
  22.       TabIndex        =   0
  23.       Text            =   "Text1"
  24.       Top             =   1200
  25.       Width           =   5535
  26.    End
  27.    Begin CommandButton Command4 
  28.       Caption         =   "UnHook "
  29.       Height          =   500
  30.       Left            =   4320
  31.       TabIndex        =   4
  32.       Top             =   480
  33.       Width           =   1335
  34.    End
  35.    Begin CommandButton Command3 
  36.       Caption         =   "Bitmap Caret"
  37.       Height          =   500
  38.       Left            =   2880
  39.       TabIndex        =   3
  40.       Top             =   480
  41.       Width           =   1335
  42.    End
  43.    Begin CommandButton Command2 
  44.       Caption         =   "OverStrike"
  45.       Height          =   500
  46.       Left            =   1560
  47.       TabIndex        =   2
  48.       Top             =   480
  49.       Width           =   1215
  50.    End
  51.    Begin CommandButton Command1 
  52.       Caption         =   "SetHook First"
  53.       Height          =   500
  54.       Left            =   120
  55.       TabIndex        =   1
  56.       Top             =   480
  57.       Width           =   1335
  58.    End
  59.    Begin Label Label1 
  60.       Alignment       =   2  'Center
  61.       Caption         =   "Highlight some text and then press 'SetHook First'"
  62.       Height          =   260
  63.       Left            =   240
  64.       TabIndex        =   5
  65.       Top             =   120
  66.       Width           =   5415
  67.    End
  68. End
  69. Declare Function LoadBitmap Lib "User" (ByVal hInstance As Any, ByVal lpBitmapName As Any) As Integer
  70. Declare Sub SetTextHook Lib "txthook.dll" (ByVal hWnd As Integer, ByVal hWnd As Integer)
  71. Declare Sub TextOverstrike Lib "txthook.dll" (ByVal bSwitch As Integer)
  72. Declare Sub CaretBitmap Lib "txthook.dll" (ByVal hBitmap As Integer)
  73. Declare Sub UndoTextHook Lib "txthook.dll" (ByVal Zero As Integer)
  74. Declare Function GetFocus Lib "User" () As Integer
  75. Const OBM_MNARROW = 32739
  76. Const TRUE = -1
  77. Const FALSE = 0
  78.  
  79. Sub Command1_Click ()
  80. Text1.SetFocus
  81. Text1wnd% = GetFocus()
  82. Call SetTextHook(Text1wnd%, hWnd)
  83. Form2.Show 1
  84. End Sub
  85.  
  86. Sub Command2_Click ()
  87. Call TextOverstrike(True)
  88. End Sub
  89.  
  90. Sub Command3_Click ()
  91. BitH% = LoadBitmap(0&, OBM_MNARROW)
  92. Call CaretBitmap(BitH%)
  93. End Sub
  94.  
  95. Sub Command4_Click ()
  96. Call UndoTextHook(0)
  97. End Sub
  98.  
  99. Sub Form_Click ()
  100.  Form2.Show 1
  101. End Sub
  102.  
  103. Sub Form_Load ()
  104. Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  105. A$ = "Uh, just one more question. Yes, what is it Columbo? "
  106. For X = 1 To 5
  107. A$ = A$ + A$
  108. Next
  109. Text1.Text = A$
  110. End Sub
  111.  
  112.